class TeamHalveSummary < ActiveRecord::Base
  belongs_to :team
  belongs_to :game

  validates_presence_of :halve, :team, :game
  validates_presence_of :first_downs
  validates_presence_of :yards_rushing 
  validates_presence_of :yards_passing
  validates_presence_of :losses 
  validates_presence_of :pass_complete 
  validates_presence_of :pass_attempts 
  validates_presence_of :interception_throwns 
  validates_presence_of :fumbles 
  validates_presence_of :fumbles_lost 
  validates_presence_of :penalties 
  validates_presence_of :penalty_yards

  def net_offense
  	return self.yards_rushing + self.yards_passing - self.losses
  end
end
